package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ForumPostsMapper;
import com.ruoyi.system.domain.ForumPosts;
import com.ruoyi.system.service.IForumPostsService;

/**
 * forumService业务层处理
 * 
 * @author zrj
 * @date 2025-07-11
 */
@Service
public class ForumPostsServiceImpl implements IForumPostsService 
{
    @Autowired
    private ForumPostsMapper forumPostsMapper;

    /**
     * 查询forum
     * 
     * @param postId forum主键
     * @return forum
     */
    @Override
    public ForumPosts selectForumPostsBypostId(Long postId)
    {
        return forumPostsMapper.selectForumPostsBypostId(postId);
    }

    /**
     * 查询forum列表
     * 
     * @param forumPosts forum
     * @return forum
     */
    @Override
    public List<ForumPosts> selectForumPostsList(ForumPosts forumPosts)
    {
        return forumPostsMapper.selectForumPostsList(forumPosts);
    }

    /**
     * 新增forum
     * 
     * @param forumPosts forum
     * @return 结果
     */
    @Override
    public int insertForumPosts(ForumPosts forumPosts)
    {
        forumPosts.setCreateTime(DateUtils.getNowDate());
        return forumPostsMapper.insertForumPosts(forumPosts);
    }

    /**
     * 修改forum
     * 
     * @param forumPosts forum
     * @return 结果
     */
    @Override
    public int updateForumPosts(ForumPosts forumPosts)
    {
        return forumPostsMapper.updateForumPosts(forumPosts);
    }

    /**
     * 批量删除forum
     * 
     * @param postIds 需要删除的forum主键
     * @return 结果
     */
    @Override
    public int deleteForumPostsBypostIds(Long[] postIds)
    {
        return forumPostsMapper.deleteForumPostsBypostIds(postIds);
    }

    /**
     * 删除forum信息
     * 
     * @param postId forum主键
     * @return 结果
     */
    @Override
    public int deleteForumPostsBypostId(Long postId)
    {
        return forumPostsMapper.deleteForumPostsBypostId(postId);
    }
}
